class Food{
}
class Fruit extends Food{
}
class Apple extends Fruit{
}
class Banana extends Fruit{
}
class Plate<T>{
    private T data;
    public T getData(){
        return data;
    }
    public void setData(T data){
        this.data=data;
    }
}
public class TestDemo {
    public static void main(String[] args) {
        Plate<Apple> plate=new Plate<>();
        plate.setData(new Apple());
        fun(plate);
        Plate<Banana> plate2 = new Plate<>() ;
        plate2.setData(new Banana());
        fun(plate2);
    }
    public static void fun(Plate<? extends Fruit> temp ){
        System.out.println(temp.getData());
    }
}
